/*************************************************************************
> File Name: 001.c
> Author: icebear
> Mail: 3322366195@qq.com
> Created Time: 2023-07-24 15:15:49
> Description: 求字符串长度
************************************************************************/

#include <stdio.h>

int main(int argc, char const *argv[])
{
    printf("input a string\n");
    char str[200] = {0};
    int length = 0;
    scanf("%s", str);
    char *p = str;
    while (*p++ != '\0')
    {
        length++;
        if (length > 200)
        {
            printf("length over bound");
            return -1;
        }
    }
    printf("the str is: %s \nlength is %d\n", str, length);
    return 0;
}
